package com.qianli.cashmama.trade.client.snapshot.enums;

/**
 * 照片类型枚举
 *
 * @author liuming
 * Created on 上午11:35 2018/11/8.
 */
public enum PhotoTypeEnum {
    KYC_FRONT_BACK(0, "kyc", "KYC FRONT AND BACK"),   // kyc 正反面
    HANDHELD(1, "handheld", "KYC HAND HELD"),
    PAN(2, "pan", "PAN"),
    SELFIE(3, "selfie", "KYC SELFIE");

    int type;
    String key;
    String desc;

    PhotoTypeEnum(int type, String key, String desc) {
        this.type = type;
        this.key = key;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public PhotoTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getKey() {
        return key;
    }

    public PhotoTypeEnum setKey(String key) {
        this.key = key;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public PhotoTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static PhotoTypeEnum getEnumsByKey(String key) {
        for (PhotoTypeEnum enums : PhotoTypeEnum.values()) {
            if (enums.getKey().equals(key)) {
                return enums;
            }
        }
        return null;
    }
}
